package cn.dzhang.spring.boot.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 操作日志实体
 *
 * @author dzhang
 * @since 2015年10月31日
 */
@Entity
@Table(name = "tbl_operation_log")
public class OperationLog extends ModelBase {

	private static final long serialVersionUID = -3379597094459301135L;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "tbl_user_id", nullable = false)
	private User user;
	private Date time;
	@Enumerated(EnumType.STRING)
	private OperationType type;
	private OperationResultType resultType;
	/**
	 * 操作的资源
	 */
	private String resource;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public OperationType getType() {
		return type;
	}

	public void setType(OperationType type) {
		this.type = type;
	}

	public OperationResultType getResultType() {
		return resultType;
	}

	public void setResultType(OperationResultType resultType) {
		this.resultType = resultType;
	}

	public String getResource() {
		return resource;
	}

	public void setResource(String resource) {
		this.resource = resource;
	}
}
